package com.example.goodsmanagementcabinet.bean;


import android.text.TextUtils;

public class KeyBean extends BaseBean implements Comparable {

    private String keyId;
    private String keyName;
    private String keyCode;
    private String location;
    private String status;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getKeyId() {
        return keyId;
    }

    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }

    public String getKeyName() {
        return keyName;
    }

    public void setKeyName(String carName) {
        this.keyName = carName;
    }

    public String getKeyCode() {
        return keyCode;
    }

    public void setKeyCode(String keyCode) {
        this.keyCode = keyCode;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Override
    public int compareTo(Object o) {
        KeyBean bean = (KeyBean) o;
        if (TextUtils.isEmpty(this.getLocation()) || TextUtils.isEmpty(bean.getLocation()) || TextUtils.equals(bean.getLocation(), " ") || TextUtils.equals(this.getLocation(), " ")) {
            return 0;
        }
        int a = Integer.parseInt(this.getLocation());
        int b = Integer.parseInt(bean.getLocation());
        if (a > b) {
            return 1;
        } else if (a < b) {
            return -1;
        }
        return 0;
    }
}
